'''
Created on 2012-9-25

@author: null
'''
from sqlalchemy import Column, Integer, Unicode, DateTime, Text, Numeric
from dao.engine import Model
from datetime import datetime


class Thing(Model):
    __tablename__ = "thing";

    id = Column(Integer, primary_key=True, nullable=False, autoincrement=True);
    user_id = Column(Integer, nullable=False);
    title = Column(Unicode(255), nullable=True);
    description = Column(Text, nullable=False);
    start_duration = Column(DateTime, default=datetime.now);
    end_duration = Column(DateTime, nullable=True, default=datetime.now);
    location = Column(Unicode(255));
    location_latitude = Column(Numeric(18, 6));
    location_longitude = Column(Numeric(18, 6));
    created_time = Column(DateTime, default=datetime.now);
    updated_time = Column(DateTime, onupdate=datetime.now);
    is_active = Column(Integer, default=1, nullable=False)
    
